package cn.doit.scala.day03

import scala.io.Source

/**
 * @DATE 2021/12/27/15:45
 * @Author MDK
 * @Version 2021.2.2
 * */
object C09_Flatten03 {
  def main(args: Array[String]): Unit = {
    Source.fromFile("d://aaa//1.txt")
      .getLines()
      .map(_.split("\\s+"))
      .toList
      .flatten
      .groupBy(e=>e)
      .map(tp=>(tp._1, tp._2.length))
      .foreach(println)
  }
}
